package itheima.d01;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilterInputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Test {
    public static void main(String[] args) throws IOException {
        Properties properties = System.getProperties();
        properties.load(new FileInputStream("D:\\javabasepro\\java AdvanceProject\\day12\\src\\itheima\\d01\\Users.properties"));


        System.out.println(properties.getProperty("username"));
        System.out.println(properties.getProperty("password"));
        System.out.println(properties.getProperty("age"));
        System.out.println("=================");


        Set<Map.Entry<Object, Object>> entries = properties.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey() + "--->" + entry.getValue());
        }


        System.out.println("=================");
        properties.forEach((key,value)-> System.out.println(key+"--->"+value));
    }



}
